<template>
  <Panel>
    <template #title> <span>商品编辑页面</span> </template>
    <template #content>
      <div>
        <span>{{ $route.params.id }}</span>
        <ckeditor v-model="editorData" :config="editorConfig"></ckeditor>
        <el-button type="primary" size="mini" @click="fn">点击发送</el-button>
      </div>
    </template>
  </Panel>
</template>

<script>
import { getProItem } from '@/api/pro.js'

export default {
  data() {
    return {
      editorData: '<p>Content of the editor.</p>',
      editorConfig: {
        // The configuration of the editor.
      }
    }
  },
  created() {
    // console.log(this.$route)
    this.getItem(this.$route.params.id)
  },
  methods: {
    async getItem(id) {
      const data = await getProItem({ id })
      console.log(data)
    },
    fn() {
      console.log(this.editorData)
    }
  }
}
</script>

<style lang="less" scoped></style>
